/**
 * 0216
 *  
 * @Author : roryrywang
 * @DateTime : 2024/8/15 22:21
 */

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

class Solution {
public:
    vector<int> tmp;
    vector<vector<int>> res;

    void dfs(int k, int n, int sum, int x) {
        if (sum > n)return;
        if (k == tmp.size()) {
            if (n == sum) {
                res.push_back(tmp);
            }
            return;
        }
        for (int i = x + 1; i <= 9; ++i) {
            tmp.push_back(i);
            dfs(k, n, sum + i, i);
            tmp.pop_back();
        }
    }

    vector<vector<int>> combinationSum3(int k, int n) {
        dfs(k, n, 0, 0);
        return res;
    }
};

int main() {

    return 0;
}